//! Demo模式快速测试
//! 
//! 快速验证Demo模式的基本功能

use binance_sdk_unified::{
    client::BinanceClientBuilder, ProductType, Environment, Result,
};

#[tokio::main]
async fn main() -> Result<()> {
    // 初始化日志
    tracing_subscriber::fmt::init();

    println!("🚀 Demo模式快速测试");
    println!("==================");

    // 测试现货Demo模式
    println!("📊 测试现货Demo模式...");
    let spot_demo_client = BinanceClientBuilder::new(
        "demo_api_key".to_string(),
        "demo_secret_key".to_string(),
        ProductType::Spot,
    )
    .environment(Environment::Demo)
    .build()?;

    println!("   REST URL: {}", spot_demo_client.config().rest_base_url());
    println!("   WebSocket URL: {}", spot_demo_client.config().ws_base_url());
    
    // 添加环境日志
    tracing::info!("[DEMO_QUICK] 现货Demo模式 - REST URL: {}", spot_demo_client.config().rest_base_url());
    tracing::info!("[DEMO_QUICK] 现货Demo模式 - WebSocket URL: {}", spot_demo_client.config().ws_base_url());

    // 测试USDT合约Demo模式
    println!("\n📈 测试USDT合约Demo模式...");
    let futures_demo_client = BinanceClientBuilder::new(
        "demo_api_key".to_string(),
        "demo_secret_key".to_string(),
        ProductType::UsdM,
    )
    .environment(Environment::Demo)
    .build()?;

    println!("   REST URL: {}", futures_demo_client.config().rest_base_url());
    println!("   WebSocket URL: {}", futures_demo_client.config().ws_base_url());
    
    // 添加环境日志
    tracing::info!("[DEMO_QUICK] USDT合约Demo模式 - REST URL: {}", futures_demo_client.config().rest_base_url());
    tracing::info!("[DEMO_QUICK] USDT合约Demo模式 - WebSocket URL: {}", futures_demo_client.config().ws_base_url());

    // 测试币本位合约Demo模式
    println!("\n🪙 测试币本位合约Demo模式...");
    let coinm_demo_client = BinanceClientBuilder::new(
        "demo_api_key".to_string(),
        "demo_secret_key".to_string(),
        ProductType::CoinM,
    )
    .environment(Environment::Demo)
    .build()?;

    println!("   REST URL: {}", coinm_demo_client.config().rest_base_url());
    println!("   WebSocket URL: {}", coinm_demo_client.config().ws_base_url());
    
    // 添加环境日志
    tracing::info!("[DEMO_QUICK] 币本位合约Demo模式 - REST URL: {}", coinm_demo_client.config().rest_base_url());
    tracing::info!("[DEMO_QUICK] 币本位合约Demo模式 - WebSocket URL: {}", coinm_demo_client.config().ws_base_url());

    println!("\n✅ Demo模式配置测试完成！");
    println!("所有产品类型都正确配置了Demo模式端点");

    Ok(())
}
